﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using QuickORM.BLL;
using QuickORM.Entity;
public partial class Manage_WebPages_Message_MessageView : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if(!IsPostBack)
        {
            string id = Request.QueryString["id"] as string;
            if(!string.IsNullOrEmpty(id))
            {
                BindPage(id);
            }
        }
    }
    protected void BindPage(string id)
    {
        T_ManagerInfo info = BLLFactory<T_ManagerInfoManager>.Instance.FindByID(int.Parse(id));
        Literal2.Text = string.Format("类别：{0}   发布人：{1}   发布时间：{2}", info.M_Type,
                                      QuickORM.Common.Util.GetRealName(info.M_Chief),
                                      Convert.ToDateTime(info.M_Time.ToString()).ToString("yyyy-MM-dd HH:mm:ss"));
        //txt_PressDate.Text = Convert.ToDateTime(info.M_Time.ToString()).ToString("yyyy-MM-dd HH:mm:ss");
        //txtFzr.Text =QuickORM.Common.Util.GetRealName(info.M_Chief);
        //txtContent.Text = info.M_Content;
        //ManagerType.Text = info.M_Type;
        Literal3.Text = info.M_Content;
        T_SystemAccessorie att =
            BLLFactory<T_SystemAccessorieManager>.Instance.FindSingle(
                string.Format("TableName='T_Manage' AND DataID ='{0}'", info.M_Id));
        if (att!=null)
        {
            Literal1.Text = string.Format("<a href='../../DownHandler.ashx?downloadurl={0}'>{1}</a>", att.FilePath, att.FileName);
        }        
    }
}